﻿using UnityEngine;

namespace Gp.Scripts.Core.Animation {
    public class ResetWeaponPos : StateMachineBehaviour {
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex) {
            if (animator.TryGetComponent<CombatantWeaponPivot>(out var pivot)) {
                pivot.BeforeWeaponTakeOut();
            }
        }

        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex) {
            if (animator.TryGetComponent<CombatantWeaponPivot>(out var pivot)) {
                pivot.OnWeaponTakeOutTrigger();
            }
        }

        public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex) { }

        public override void OnStateMove(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex) { }

        public override void OnStateIK(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex) { }
    }
}